package zhongbo.java.air.AirIngestion.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import zhongbo.java.air.AirIngestion.config.RedisListenerConfig;

@Component
@Slf4j
public class RedisLogChaneIPublisher {
    @Autowired
    private RedisTemplate<String,String> redisTemplate;

    // 发布消息
    public void sendMessage(String message){
        // 向指定channel发送消息
        redisTemplate.convertAndSend(RedisListenerConfig.INJEST_CHANNEL, message);
    }

}
